package com.sooth.micro.field.mapper;

import com.dream.system.annotation.Mapper;
import com.dream.system.annotation.Param;
import com.dream.system.annotation.Sql;
import com.sooth.micro.field.view.MicroFieldBo;

import java.util.List;

@Mapper
public interface MicroFieldMapper {
    @Sql("delete from micro_field where entity_id=:entityId")
    int deleteByEntityId(@Param("entityId") Long entityId);

    @Sql("select @*() from micro_field where entity_id=:entityId")
    List<MicroFieldBo> selectByEntityId(Long entityId);

    @Sql("select @*() from micro_field where entity_id=:entityId and pk=1")
    List<MicroFieldBo> selectPkByEntityId(Long entityId);

    @Sql("select @*() from micro_field where entity_id=:entityId and add_value is not null and add_value<>''")
    List<MicroFieldBo> selectAddValueByEntityId(Long entityId);

    @Sql("select @*() from micro_field where entity_id=:entityId and edit_value is not null and edit_value<>''")
    List<MicroFieldBo> selectEditValueByEntityId(Long entityId);
}
